<!DOCTYPE html>
<html>
<head>  
<meta charset="utf-8">
<title>登入 - {:config('web.WEB_AUT')}</title>
<meta name="keywords" content="{:config('web.WEB_KEY')}">
<meta name="description" content="{:config('web.WEB_DES')}">
{include file="forum/header"}
<div class="main layui-clear">
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief">
      <ul class="layui-tab-title">
        <li class="layui-this">登入</li>
        <li><a href="{:url('login/reg')}">注册</a></li>
      </ul>
      <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <div class="layui-form layui-form-pane">
            <form method="post">
              <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-inline">
                  <input type="text" name="usermail" required lay-verify="required|email|emails|emailss" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                  <input type="password" name="password" required lay-verify="required|pass" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">验证码</label>
                <div class="layui-input-inline">
                  <input type="text" name="code" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
			        <div class="" style="float: left;margin-bottom: 20px;">
                <img src="{:captcha_src()}" onclick="this.src='{:captcha_src()}?'+Math.random();" style="float:left; cursor:pointer;" alt="captcha" />
              </div>
              <div class="layui-form-item">
                <button class="layui-btn" lay-submit="" lay-filter="login_index">立即登录</button>
              </div>
<!--               <div class="layui-form-item fly-form-app">
                <span>或者使用社交账号登入</span>
                <a href="http://fly.layui.com:8098/app/qq" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-qq" title="QQ登入"></a>
                <a href="http://fly.layui.com:8098/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-weibo" title="微博登入"></a>
              </div>  -->             
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
{include file="forum/footer"}
<script type="text/javascript">
layui.use('form',function(){
  var form = layui.form()
  ,jq = layui.jquery;

  form.verify({
    emails: function(value){
      if(value.length < 10){
        return '邮箱必须大于10位';
      }
    }
	,emailss: function(value){
      if(value.length > 32){
        return '邮箱必须小于32位';
      }
    }
    ,pass: [/(.+){6,12}$/, '密码必须6到12位']
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });

  form.on('submit(login_index)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("login/index")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("user/set")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });

})
</script>
</body>
</html>